-- GENERATED SPELL FOR [Sunfury Flamekeeper] --


function spell0_20221(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_20221', 540, 1)
end

function spell1_20221(pUnit, Event) --@Judgement of the Flame,n/a--
pUnit:FullCastSpellOnTarget(33731,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20221', 8318, 1)
end

function spell2_20221(pUnit, Event) --@Torch,n/a--
pUnit:FullCastSpellOnTarget(35857,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20221', 584, 1)
end

function Sorts_20221(pUnit, Event)
local choix_sorts_20221 = math.random(0, 2)
if choix_sorts_20221 == 0 then
pUnit:RegisterEvent('spell0_20221', 1, 1)
end
if choix_sorts_20221 == 1 then
pUnit:RegisterEvent('spell1_20221', 1, 1)
end
if choix_sorts_20221 == 2 then
pUnit:RegisterEvent('spell2_20221', 1, 1)
end
end

function mob20221_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20221', math.random(1500, 3000), 1)
end

function mob20221_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20221_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20221_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20221, 1, 'mob20221_Action')
RegisterUnitEvent(20221, 2, 'mob20221_Leave')
RegisterUnitEvent(20221, 3, 'mob20221_Kill')
RegisterUnitEvent(20221, 4, 'mob20221_Die')
